﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace CodeCamp.Models.EventMgmt
{
    public class EventEditViewModel
    {
        public int Id { get; set; }

        [Required]
        [MaxLength(64), MinLength(0)]
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string DisplayDate { get; set; }

        [Required]
        [MaxLength(128), MinLength(0)]
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string DisplayLocation { get; set; }

        [Required]
        [MaxLength(128)]
        public string DisplayName { get; set; }

        [Required]
        public Decimal DisplaySortOrder { get; set; }

        [Required]
        public bool EventIsPublic { get; set; }

        [Required]
        [MinLength(0),MaxLength(128)]
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string RegistrationUrl { get; set; }

        [MaxLength(172)]
        public string SchedulePdfUrl { get; set; }

        [Required]
        public DateTime SessionSubmissionsOpen { get; set; }

        [Required]
        public DateTime SessionSubmissionsClose { get; set; }

        [Required]
        [MaxLength(32)]
        public string ShortName { get; set; }

        [Required]
        public DateTime EventStartDate { get; set; }

        /// <summary>
        /// When true, Presenter who presented at old event where 
        /// Presenter record is not connected to a login is allowed to
        /// edit profile and connect it to new login with same email address.
        /// </summary>
        [Required]
        public bool DisconnectedPresenterProfileConnectionAllowed { get; set; }

        [Required]
        public bool AgendaIsPublic { get; set; }

        [Required]
        public bool ScheduleIsPublic { get; set; }

        [Required]
        public bool ScheduleVisibleToPresenters { get; set; }

        /// <summary>
        /// When true, a Presenter who has presented at an old event
        /// and is creating a profile for a new event will get the data
        /// from the old profile as the defaults for the new profile.
        /// </summary>
        [Required]
        public bool PriorEventProfileReuseAllowed { get; set; }

        /// <summary>
        /// If EventIsPublic is false, but UserIsInRole of this role, user can see event.
        /// </summary>
        [MaxLength(30)]
        public string NonPublicEventPreviewRole { get; set; }
    }
}